#include <iostream>     // std::cout, std::cin
#include <algorithm>    // std::sort
#include <vector>       // std::vector
#include "grafo.h"

using namespace std;

int n, m, u, v, K;


Nodo::Nodo(int numero): numero(numero)
{
  this->w.resize(n+1);
  return;
}



void Nodo::agregarAdyacente(Nodo * n2)
{
  int w1, w2;
  cin >> w1;
  cin >> w2;

  this->adyacentes.push_back(n2);
  this->w[n2->numero] = make_pair(w1, w2);
  n2->adyacentes.push_back(this);
  n2->w[this->numero] = make_pair(w1, w2);
  return;
}

vector<Nodo> crearGrafo()
{
  cin >> n;
  cin >> m;
  cin >> u;
  cin >> v;
  cin >> K;

  vector<Nodo> nodos;

  nodos.push_back(Nodo(0));

  for (int i = 0; i <= n; i++)
  {
    nodos.push_back(Nodo(i+1));
  }

  for (int i = 0; i < m; i++)
  {
    int n1, n2;
    cin >> n1;
    cin >> n2;
    nodos[n1].agregarAdyacente(&nodos[n2]);
  }
  return nodos;
}
